home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesS-T.lzh / TheCartoons.lha / TheCartoons_Hd / Install < prev    next >
Text File  |  2002-06-23  |  11KB  |  377 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")                       ;sub directory containing data files
  4. (set #readme-file "ReadMe")             ;name of readme file
  5. (set #man-file "Manual")                ;name of manual file
  6. (set #hint-file "Hints")                ;name of hint file
  7. (set #sol-file "Solution")              ;name of solution file
  8. (set #highs-file "TheCartoon.save")               ;name of high scores file
  9. (set #prefix @app-name)                 ;name of slave, directory
  10.  
  11. (set #ico_suffix_00 "inf")              ;Icon suffixes (not all of these must exist)
  12. (set #ico_suffix_01 "magicwb")
  13. (set #ico_suffix_02 "romicon")
  14. (set #ico_suffix_03 "newicon")
  15. (set #ico_suffix_04 "newexot")
  16. (set #ico_suffix_05 "coloricon")
  17. (set #ico_suffix_06 "colexot")
  18. (set #ico_suffix_07 "colfrank")
  19. (set #ico_suffix_08 "colchris")
  20. (set #ico_suffix_09 "colcode")
  21. (set #ico_suffix_10 "colcfou")
  22. (set #ico_suffix_11 "colakira")
  23.  
  24. ;Icon descriptions (max 21 chars if you have > 9 entries, or 27 chars otherwise.
  25. ;These are renamed to "gamename.info" so no illegal characters like :/* etc
  26. ;                 "123456789012345678901234567"
  27. (set #ico_desc_00 "Normal")
  28. (set #ico_desc_01 "MagicWB Icon")
  29. (set #ico_desc_02 "RomIcon")
  30. (set #ico_desc_03 "NewIcon")
  31. (set #ico_desc_04 "NewIcon by Exotica")
  32. (set #ico_desc_05 "OS3.5 Icon")
  33. (set #ico_desc_06 "OS3.5 Icon by Exotica")
  34. (set #ico_desc_07 "OS3.5 Icon by Frank")
  35. (set #ico_desc_08 "OS3.5 Icon by Chris Vella")
  36. (set #ico_desc_09 "OS3.5 Icon by Codetapper")
  37. (set #ico_desc_10 "OS3.5 Icon by CFou")
  38. (set #ico_desc_11 "OS3.5 Icon by Akira")
  39.  
  40. (procedure P_MakeImages
  41.  
  42.   ;the following lines must be copied and adjusted for multiple disk images
  43.  
  44.   (set #CI_disknum 1)
  45.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  46.   (set #CI_disklen 901120)
  47.   (set #CI_skiptrk "")
  48.   (P_CreateImage)
  49.  
  50.   ;for example...
  51.   (set #CI_disknum 2)
  52.   (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  53.   (P_CreateImage)
  54.  
  55. )
  56.  
  57. ;****************************
  58. ;----------------------------
  59. ; checks if given program is installed, if not abort install
  60. ; #program - to check
  61.  
  62. (procedure P_ChkRun
  63.   (if (= 0 (run ("cd SYS:\nWhich %s >NIL:" #program)))
  64.     ("")
  65.     (abort
  66.       (cat
  67.         "You must install \"" #program "\" first!\n"
  68.         "It must be accessible via the path.\n"
  69.         "You can find it in the WHDLoad package."
  70.       )
  71.     )
  72.   )
  73. )
  74.  
  75. ;----------------------------
  76. ; Create Image using DIC
  77. ; #dest        - path to save image in
  78. ; #CI_disknum  - number of the disk image to create
  79. ; #CI_diskname - label of the disk
  80. ; #CI_disklen  - length of disk image to create
  81. ; #CI_skiptrk  - track to skip, -1 means no skip
  82. ; #CI_drive    - drive to create image from
  83.  
  84. (procedure P_CreateImage
  85.   (message
  86.     (cat
  87.         "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  88.         "(make sure it's the right disk because it will not be checked)"
  89.     )
  90.   )
  91.   (if (= #CI_skiptrk "")
  92.     (set #option "")
  93.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  94.   )
  95.   (if
  96.     (= 0
  97.       (run
  98.         (cat
  99.           "cd \"" #dest "\"\n"
  100.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  101.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  102.         )
  103.       )
  104.     )
  105.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  106.     (abort "\"DIC\" has failed to create a diskimage")
  107.   )
  108. )
  109.  
  110. ;----------------------------
  111. ; copy file including icon if exist
  112. ; #copy-file - name of file to copy
  113.  
  114. (procedure P_CopyFile
  115.   (if (exists #copy-file) (
  116.     (copyfiles
  117.       (help @copyfiles-help)
  118.       (source #copy-file)
  119.       (dest #dest)
  120.     )
  121.     (if (exists ("%s.info" #copy-file)) (
  122.       (copyfiles
  123.         (help @copyfiles-help)
  124.         (source ("%s.info" #copy-file))
  125.         (dest #dest)
  126.       )
  127.       (tooltype
  128.         (dest (tackon #dest #copy-file))
  129.         (noposition)
  130.       )
  131.     ))
  132.   ))
  133. )
  134.  
  135. ;****************************
  136.  
  137. (if (< @installer-version (+ (* 44 65536) 10))
  138.   (
  139.     (message
  140.       (cat
  141.         "Warning: your installer is outdated.\n"
  142.         "Some features of this installation won't be available, "
  143.         "such as icon show and drawer opening. "
  144.         "You have version " (/ @installer-version 65536) "." 
  145.         (BITAND @installer-version 65535) ", recommended is version 44.10. "
  146.         "The 'installer' 44.10 comes with OS 3.5 but is also contained in the NDK 3.9. "
  147.         "You may also use the InstallerNG by Jens Tröger."
  148.         "\n\n"
  149.         "The installers can be obtained from the net:\n"
  150.         "http://www.amiga.com/3.9/download/NDK3.9.lha\n"
  151.         "aminet:util/sys/InstallerNG.lha"
  152.       )
  153.     )
  154.     (set #newstuff 0)
  155.   )
  156.   (set #newstuff 1)
  157. )
  158.  
  159. (if (exists #readme-file)
  160.   (if (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  161.     ("")
  162.     (run ("SYS:Utilities/More %s" #readme-file))
  163.   )
  164. )
  165.  
  166. (set #program "WHDLoad")
  167. (P_ChkRun)
  168.  
  169. (set #program "DIC")
  170. (P_ChkRun)
  171.  
  172. (if (= @user-level 2)
  173.   (
  174.     (set #CI_drive
  175.       (askchoice
  176.         (prompt "Select source drive for diskimages")
  177.         (default 0)
  178.         (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  179.         (help @askchoice-help)
  180.       )
  181.     )
  182.     (select #CI_drive
  183.       (set #CI_drive "DF0:")
  184.       (set #CI_drive "DF1:")
  185.       (set #CI_drive "RAD:")
  186.       (set #CI_drive
  187.         (askstring
  188.           (prompt "Select source drive for diskimages")
  189.           (default "DF0:")
  190.           (help @askstring-help)
  191.         )
  192.       )
  193.     )
  194.   )
  195.   (set #CI_drive "DF0:")
  196. )
  197.  
  198. (if (getenv "WHDLInstPath")
  199.   (set @default-dest (getenv "WHDLInstPath"))
  200. )
  201. (set #dest
  202.   (askdir
  203.     (prompt
  204.       (cat
  205.         "Where should \"" @app-name "\" be installed?\n"
  206.         "A drawer \"" #prefix "\" will be automatically created."
  207.       )
  208.     )
  209.     (help @askdir-help)
  210.     (default @default-dest)
  211.   )
  212. )
  213. (run ("setenv WHDLInstPath \"%s\"\ncopy ENV:WHDLInstPath ENVARC:" #dest))
  214. (set #dest (tackon #dest #prefix))
  215. (if (exists #dest) (
  216.   (set #choice
  217.     (askbool
  218.       (prompt
  219.         (cat
  220.           "\nDirectory \"" #dest "\" already exists.\n"
  221.           "Should it be deleted?"
  222.         )
  223.       )
  224.       (default 1)
  225.       (choices "Delete" "Skip")
  226.       (help @askbool-help)
  227.     )
  228.   )
  229.   (if (= #choice 1)
  230.     (delete #dest
  231.       (help @delete-help)
  232.       (all)
  233.     )
  234.   )
  235. ))
  236. (makedir #dest
  237.   (help @makedir-help)
  238.   (infos)
  239. )
  240.  
  241. ;----------------------------
  242.  
  243. (copyfiles
  244.   (help @copyfiles-help)
  245.   (source ("%s.Slave" #prefix))
  246.   (dest #dest)
  247. )
  248. (set #icon 0)
  249. (if (exists ("%s.%s" #prefix #ico_suffix_11)) ((set #icon 11)(set #icnt (+ 1 #icnt))(set #icon_11 #ico_desc_11)) (set #icon_11 ""))
  250. (if (exists ("%s.%s" #prefix #ico_suffix_10)) ((set #icon 10)(set #icnt (+ 1 #icnt))(set #icon_10 #ico_desc_10)) (set #icon_10 ""))
  251. (if (exists ("%s.%s" #prefix #ico_suffix_09)) ((set #icon 9) (set #icnt (+ 1 #icnt))(set #icon_09 #ico_desc_09)) (set #icon_09 ""))
  252. (if (exists ("%s.%s" #prefix #ico_suffix_08)) ((set #icon 8) (set #icnt (+ 1 #icnt))(set #icon_08 #ico_desc_08)) (set #icon_08 ""))
  253. (if (exists ("%s.%s" #prefix #ico_suffix_07)) ((set #icon 7) (set #icnt (+ 1 #icnt))(set #icon_07 #ico_desc_07)) (set #icon_07 ""))
  254. (if (exists ("%s.%s" #prefix #ico_suffix_06)) ((set #icon 6) (set #icnt (+ 1 #icnt))(set #icon_06 #ico_desc_06)) (set #icon_06 ""))
  255. (if (exists ("%s.%s" #prefix #ico_suffix_05)) ((set #icon 5) (set #icnt (+ 1 #icnt))(set #icon_05 #ico_desc_05)) (set #icon_05 ""))
  256. (if (exists ("%s.%s" #prefix #ico_suffix_04)) ((set #icon 4) (set #icnt (+ 1 #icnt))(set #icon_04 #ico_desc_04)) (set #icon_04 ""))
  257. (if (exists ("%s.%s" #prefix #ico_suffix_03)) ((set #icon 3) (set #icnt (+ 1 #icnt))(set #icon_03 #ico_desc_03)) (set #icon_03 ""))
  258. (if (exists ("%s.%s" #prefix #ico_suffix_02)) ((set #icon 2) (set #icnt (+ 1 #icnt))(set #icon_02 #ico_desc_02)) (set #icon_02 ""))
  259. (if (exists ("%s.%s" #prefix #ico_suffix_01)) ((set #icon 1) (set #icnt (+ 1 #icnt))(set #icon_01 #ico_desc_01)) (set #icon_01 ""))
  260. (if (exists ("%s.%s" #prefix #ico_suffix_00)) ((set #icon 0) (set #icnt (+ 1 #icnt))(set #icon_00 #ico_desc_00)) (set #icon_00 ""))
  261. (procedure P_Icon
  262.   (copyfiles
  263.     (help @copyfiles-help)
  264.     (source ("%s.%s" #prefix #icon-suf))
  265.     (newname ("%s.info" #icon-name))
  266.     (dest #icon-dir)
  267.   )
  268.   (tooltype
  269.     (dest (tackon #icon-dir #icon-name))
  270.     (noposition)
  271.   )
  272. )
  273. (if (> #icnt 1) (
  274.   (if (= #newstuff 1) (
  275.     (set #icon-dir ("T:%s Icons" #prefix))
  276.     (makedir #icon-dir
  277.       (help @makedir-help)
  278.     )
  279.     (if #icon_00 ((set #icon-suf #ico_suffix_00) (set #icon-name #ico_desc_00) (P_Icon)))
  280.     (if #icon_01 ((set #icon-suf #ico_suffix_01) (set #icon-name #ico_desc_01) (P_Icon)))
  281.     (if #icon_02 ((set #icon-suf #ico_suffix_02) (set #icon-name #ico_desc_02) (P_Icon)))
  282.     (if #icon_03 ((set #icon-suf #ico_suffix_03) (set #icon-name #ico_desc_03) (P_Icon)))
  283.     (if #icon_04 ((set #icon-suf #ico_suffix_04) (set #icon-name #ico_desc_04) (P_Icon)))
  284.     (if #icon_05 ((set #icon-suf #ico_suffix_05) (set #icon-name #ico_desc_05) (P_Icon)))
  285.     (if #icon_06 ((set #icon-suf #ico_suffix_06) (set #icon-name #ico_desc_06) (P_Icon)))
  286.     (if #icon_07 ((set #icon-suf #ico_suffix_07) (set #icon-name #ico_desc_07) (P_Icon)))
  287.     (if #icon_08 ((set #icon-suf #ico_suffix_08) (set #icon-name #ico_desc_08) (P_Icon)))
  288.     (if #icon_09 ((set #icon-suf #ico_suffix_09) (set #icon-name #ico_desc_09) (P_Icon)))
  289.     (if #icon_10 ((set #icon-suf #ico_suffix_10) (set #icon-name #ico_desc_10) (P_Icon)))
  290.     (if #icon_11 ((set #icon-suf #ico_suffix_11) (set #icon-name #ico_desc_11) (P_Icon)))
  291.     (openwbobject #icon-dir)
  292.   ))
  293.   (set #icon
  294.     (askchoice
  295.       (prompt "\nWhich icon would you like to install?\n")
  296.       (choices #icon_00 #icon_01 #icon_02 #icon_03 #icon_04 #icon_05 #icon_06 #icon_07 #icon_08 #icon_09 #icon_10 #icon_11)
  297.       (default #icon)
  298.       (help @askchoice-help)
  299.     )
  300.   )
  301.   (if (= #newstuff 1) (
  302.     (closewbobject #icon-dir)
  303.     (delete #icon-dir
  304.       (help @delete-help)
  305.       (all)
  306.     )
  307.   ))
  308. ))
  309. (select #icon
  310.   (set #icon #ico_suffix_00)
  311.   (set #icon #ico_suffix_01)
  312.   (set #icon #ico_suffix_02)
  313.   (set #icon #ico_suffix_03)
  314.   (set #icon #ico_suffix_04)
  315.   (set #icon #ico_suffix_05)
  316.   (set #icon #ico_suffix_06)
  317.   (set #icon #ico_suffix_07)
  318.   (set #icon #ico_suffix_08)
  319.   (set #icon #ico_suffix_09)
  320.   (set #icon #ico_suffix_10)
  321.   (set #icon #ico_suffix_11)
  322. )
  323. (copyfiles
  324.   (help @copyfiles-help)
  325.   (source ("%s.%s" #prefix #icon))
  326.   (newname ("%s.info" #prefix))
  327.   (dest #dest)
  328. )
  329. (if (= #icon "newicon")
  330.   ("")
  331.   (
  332.     (tooltype
  333.       (dest (tackon #dest #prefix))
  334.       (settooltype "Slave")
  335.       (settooltype "PreLoad")
  336.       (settooltype "CUSTOM1")
  337.     )
  338.     (tooltype
  339.       (dest (tackon #dest #prefix))
  340.       (settooltype "CUSTOM1" "1")
  341.       (settooltype "PreLoad" "")
  342.       (settooltype "Slave" ("%s.Slave" #prefix))
  343.     )
  344.   )
  345. )
  346. (tooltype
  347.   (dest (tackon #dest #prefix))
  348.   (setdefaulttool "WHDLoad")
  349.   (setstack 10240)
  350.   (noposition)
  351. )
  352. (set #copy-file #readme-file)
  353. (P_CopyFile)
  354. (set #copy-file #man-file)
  355. (P_CopyFile)
  356. (set #copy-file #hint-file)
  357. (P_CopyFile)
  358. (set #copy-file #sol-file)
  359. (P_CopyFile)
  360. (set #dest-org #dest)
  361. (if (= #sub-dir "")
  362.   ("")
  363.   (
  364.     (set #dest (tackon #dest #sub-dir))
  365.     (makedir #dest
  366.       (help @makedir-help)
  367.     )
  368.   )
  369. )
  370. (set #copy-file #highs-file)
  371. (P_CopyFile)
  372. (P_MakeImages)
  373. (if (= #newstuff 1)
  374.   (openwbobject #dest-org)
  375. )
  376. (exit)
  377.